home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / polyAppendValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.3 KB  |  111 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // this proc points the tool properties
  19. // window to the current polyAppend context
  20.  
  21. global proc callPolyAppendFacetCtx(string $in, string $toolName)
  22. {
  23.     if ($in == "Normalize") $inval = 1;
  24.     else if ($in == "Unitize") $inval = 2;
  25.     else $inval = 0;    // Default should go here.
  26.     eval("polyAppendFacetCtx -e -tx " + $inval + " " + $toolName);
  27. }
  28.  
  29. global proc changeMaxPointsValueAppend(int $val, string $toolName)
  30. {
  31.     if ($val < 3)
  32.     {
  33.         $val = -1;
  34.         intSliderGrp -e -v $val maxPointsSlider;
  35.         disable -v false subdSld;
  36.     }
  37.     else {
  38.         polyAppendFacetCtx -e -s 1 $toolName;    
  39.         intSliderGrp -e -v 1 subdSld;
  40.         disable subdSld;
  41.     }
  42.     eval("polyAppendFacetCtx -e -mp " + $val + " " + $toolName);
  43. }
  44.  
  45. global proc polyAppendValues ( string $toolName )
  46. {
  47.     string $name = "polyAppend";
  48.     string $parent = (`toolPropertyWindow -q -location` + "|" + $name);
  49.     setParent $parent;
  50.  
  51.     // operation
  52.     //
  53.     int $mode = `polyAppendFacetCtx -q -ap $toolName`;
  54.     if( $mode )
  55.         radioButtonGrp -e -sl 2 newFacetRadio; // append
  56.     else
  57.         radioButtonGrp -e -sl 1 newFacetRadio; // create
  58.     radioButtonGrp -e
  59.         -on1 ("polyAppendFacetCtx -e -ap false " +$toolName)
  60.         -on2 ("polyAppendFacetCtx -e -ap true "  +$toolName)
  61.         newFacetRadio;
  62.     
  63.     // Subdivisions
  64.     //
  65.     intSliderGrp -e
  66.         -v  `polyAppendFacetCtx -q -s $toolName`
  67.         -cc ("polyAppendFacetCtx -e -s #1 " +$toolName)
  68.         subdSld;
  69.     int $maxP = `polyAppendFacetCtx -q -mp $toolName`;
  70.     if ($maxP < 3)
  71.         disable -v false subdSld;
  72.     else
  73.         disable subdSld;
  74.  
  75.     // Max points    
  76.     intSliderGrp -e
  77.         -v `polyAppendFacetCtx -q -mp $toolName`
  78.         -cc ("changeMaxPointsValueAppend #1 " + $toolName)
  79.         maxPointsSlider;            
  80.     
  81.     // Texture
  82.     //
  83.     // checkBox -e
  84.     int $val = `polyAppendFacetCtx -q -tx $toolName` + 1;
  85.     optionMenuGrp -edit 
  86.         -sl    $val
  87.         -cc ("callPolyAppendFacetCtx #1 " +$toolName)
  88.         textureBox;
  89.  
  90.     // Rotation
  91.     //
  92.     floatSliderGrp -e
  93.         -en `polyAppendFacetCtx -q -isr $toolName`
  94.         -v  `polyAppendFacetCtx -q -r $toolName`
  95.         -cc ("polyAppendFacetCtx -e -r #1 " +$toolName)
  96.         -dc ("polyAppendFacetCtx -e -r #1 " +$toolName)
  97.         angSld;
  98.       
  99.     // Planar constraint
  100.     //
  101.     checkBoxGrp -e
  102.         -value1   `polyAppendFacetCtx -q -pc $toolName`
  103.         -on1 togglePolyPlanarConstraints 
  104.         -of1 togglePolyPlanarConstraints
  105.         planarBox;
  106.     
  107.     string $helpTag= "AppendtoPolygonTool";
  108.     toolPropertySetCommon $toolName "polyAppendFacet.xpm" $helpTag;
  109.     toolPropertySelect $name;
  110. }
  111.